package com.rectcircle.wechat.msg.vo;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 * 模板消息的封装<br>
 * 
 * 
 * @author RectCircle
 * @version 0.1<br>
 * 2016年7月25日-下午11:28:51<br>
 * Copyright (c) 2016 RectCircle-版权所有<br>
 *
 */
public class TmMessage {
	private String touser = null;
	private String template_id = null;
	private String url = null;
	private Map<String, TmParam> data = null;
	public TmMessage() {
	}
	/**
	 * @param touser 要发送用户的openid
	 * @param template_id 发送模板的模板id
	 * @param url 模板消息是的跳转url
	 */
	public TmMessage(String touser, String template_id, String url) {
		this.touser = touser;
		this.template_id = template_id;
		this.url = url;
	}
	
	public void addParam(String key, TmParam param){
		if(data==null){
			data = new HashMap<>();
		}
		data.put(key, param);
	}
	
	public Map<String, TmParam> getData() {
		return data;
	}
	public String getTemplate_id() {
		return template_id;
	}
	public String getTouser() {
		return touser;
	}
	public String getUrl() {
		return url;
	}
	public void setData(Map<String, TmParam> data) {
		this.data = data;
	}
	public void setTemplate_id(String template_id) {
		this.template_id = template_id;
	}
	public void setTouser(String touser) {
		this.touser = touser;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	
}
